﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Windows.Media;

namespace Chaos.model
{
    public class oldworldmap : INotifyPropertyChanged, stream.streamable
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected void Notify(string property)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }

        private ObservableCollection<region> regions = new ObservableCollection<region>();
        public ObservableCollection<region> Regions
        {
            get { return regions; }
            set
            {
                if (regions != value)
                {
                    regions = value;
                    Notify("Regions");
                }
            }
        }

        public ImageSource oldworldimage;
        public ImageSource OldWorldImage
        {
            get { return oldworldimage; }
            set
            {
                if (oldworldimage != value)
                {
                    oldworldimage = value;
                    Notify("OldWorldImage");
                }
            }
        }



        public virtual void serialize(stream.stream io_Stream)
        {
            io_Stream.begin("oldworldmap")
                .serialize("regions", ref regions)
            .end();
        }
    }
}
